<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="x-ua-compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Echarts演示</title>
    <script src="/js/plugins/echarts/echarts.common.min.js"></script>
</head>
<body>
<!-- 为 ECharts 准备一个具备大小（宽高）的 DOM -->
<div id="main" style="width: 1200px;height:800px;"></div>
<script>
    var chartDom = document.getElementById('main');
    var myChart = echarts.init(chartDom);
    var option;

    option = {
        legend: {},
        tooltip: {},
        dataset: {
            source: [
                ['分组类型', '总消费数', '总优惠数', '总实付数'],
                <#list items as item>
                ['${item.groupByName}', ${item.totalAmount}, ${item.totalDiscountAmount}, ${item.totalPayAmount}]
                <#if item_index < items?size-1>
                ,
                </#if>

                </#list>
            ]
        },
        xAxis: {type: 'category'},
        yAxis: {},
        // Declare several bar series, each will be mapped
        // to a column of dataset.source by default.
        series: [
            {type: 'bar'},
            {type: 'bar'},
            {type: 'bar'}
        ]
    };

    option && myChart.setOption(option);
</script>
</body>
</html>